<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
  <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  <link rel="stylesheet" href="../../css/animate.css">
  <link rel="stylesheet" href="../../iconfont/iconfont.css">
  <link rel="stylesheet" href="../../css/mescroll.css">
  <link rel="stylesheet" href="../../css/gloab.css">
  <title>搜索结果</title>
</head>
<style>
  .mescroll{
    position: fixed;
       top: 0.99rem;
       bottom: 0.99rem;
       height: auto;
       left:0;
       right:0;
  }
  .none-order{
    text-align: center;
    color:#727272;
    line-height: 200%;
    margin-top: 1rem;
  }
</style>
<body>
  <div id="app">
    <div id="public-header">
      <div id="statusbar"></div>
      <header class="public-header">
        <div class="public-header-lf iconfont icon-fanhui" @click="javascript:api.closeWin();"></div>
        <div class="public-header-title">搜索</div>
      </header>
    </div>
    <div class="dating-body auto" style="padding-bottom:0.5rem;">
      <div id="mescroll" class="mescroll">
          <div class="product-category-list">
            <div class="product-category-list-son" v-for="(item,index) in soudata">
              <div class="product-category-list-header flex wrap">
                  <div class="product-category-list-header-lf">
                      <img :src="apiUrl+item.avatar" alt="">
                      <label class="product-category-list-header-label">{{item.rank}}</label>
                  </div>
                  <div class="product-category-list-header-rt">
                    <div class="product-category-list-header-name flex">
                      <div class="product-category-list-header-name-lf F5">{{item.nickname}}</div>
                      <div class="product-category-list-header-name-rt F1" @click="kongjian(item.users_id)">空间&nbsp;></div>
                    </div>
                    <div class="product-category-list-header-name flex">
                      <div class="product-category-list-header-name-lb F5">
                        <span class="zd-label">置顶</span>
                        <span class="zdsx-label">自动刷新</span>
                      </div>
                      <div class="product-category-list-header-name-rt F1" style="margin-top:0;" @click="aboutcontet(item.users_id,item.id)">详情&nbsp;></div>
                    </div>
                  </div>
              </div>
              <div class="product-category-list-text">{{item.content}}</div>
              <div v-if="item.images&&item.images.length>0">
                 <div class="product-category-list-imgs flex wrap">
                   <div class="product-category-list-img" v-if="index<3" :style="index==0?'margin-left:0;':''" v-for="(item,index) in item.images.split(',')">
                     <img :src="apiUrl1+item" alt="">
                   </div>
                   <div class="product-category-list-img">
                     <img src="../../image/public/home8.png" alt="">
                     <div class="product-category-list-modify" @click="javascript:api.openWin({name: 'guanggao_details',reload:true,url:'./guanggao_details.html',pageParam: {index: item.id}});">更多图片</div>
                   </div>
                 </div>
               </div>
              <div class="product-category-list-footer clearfix">
                <span class="wshy">{{item.section_id}}</span>
                <span>曝光次数：{{item.Impressions}}&nbsp;&nbsp;刷新：37秒前</span>
                <div class="product-category-list-share fr">
                  <img src="../../image/public/home9.png" alt="">
                </div>
              </div>
            </div>
          </div>
          <div v-if="soudata.length<=0" class="none-order">
              <span>暂无数据</span>
          </div>
      </div>
    </div>
  <div class="public-progress" style="z-index:9;">
    <img src="../../icon/icon150x150.png" alt="" class="animated infinite flash" style="width:200px;height:200px;display:block;margin:200px auto;">
  </div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/jquery.js"></script>
<script src="../../script/mescroll.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script>
var vm;
var mescroll;
var mySwiper;
apiready=function(){
	console.log("nihao")
    api.removeLaunchView();
     setBar("statusbar");
     setFont(750);
     startVue();
     $(".public-progress").fadeOut(1000);
     setTimeout(function(){
       $(".public-progress").css({"display":"none"});
     },1000);
    }
function startVue(){
  vm = new Vue({
    el:"#app",
    data:{
      gdtt:['50','100','200','300','500','1000'],
      num:0,
      soudata:[],
      page:0,
      showpage:6,
    },
    created:function(){
		console.log("nihao")
      this.getsoushuo();
    },
    mounted:function(){
		console.log("nihao")
       this.initMescroll();
       var top=$("#public-header").outerHeight(true)+$("#nav").outerHeight(true);
       $("#mescroll").css({"top":top+"px"});
	    this.getsoushuo();
     },
    methods:{
   /*   more:function(obj){
        if(obj.num){
          vm.page++;
          vm.getsoushuo();
        }else{
          vm.page=0;
          vm.getsoushuo();
        }
      }, */
        //搜索页面
      getsoushuo:function(){
		  console.log( """guanjianci""")
        var self = this;
        var guanjianci=api.pageParam['guanjianci'];
		console.log( guanjianci)
        api.ajax({
            url: apiUrl+'/api/index/search',
            method: 'post',
            data: {
                values: {
                    keywords:guanjianci,
                },
            }
        },function(ret, err){
          if (ret.code==1) {
            self.soudata = ret.data;
			console.log( JSON.stringify(self.soudata))
          }
          setTimeout(function() {
              self.mescroll.endSuccess();
              vm.mescroll.endUpScroll(false);
            }, 500)
        });
      },
      //详情
      aboutcontet:function(users_id,id){
          api.openWin({
          name: 'xiangqing',
          url: '../personal/guanggao_details.html',
          reload:true,
          pageParam: {
              uid:users_id,
              id:id
            }
          });
        },
          //个人空间
      kongjian(users_id){
          api.openWin({
          name: 'kongjian',
          url: '../personal/kongjian.html',
          reload:true,
          pageParam: {
                uid:users_id
            }
          });
        },
        initMescroll:function(){
          this.mescroll = new MeScroll("mescroll", {
            down:{
              use:true,
              auto:true,
              autoShowLoading:true,
              callback: this.more, //下拉刷新的回调,别写成downCallback(),多了括号就自动执行方法了
            },
            up:{
              use:true,
              auto:false,
              lazyLoad: {
                use: true, // 是否开启懒加载,默认false
                attr: 'imgurl', // 网络地址的属性名 (图片加载成功会移除该属性): <img imgurl='网络图  src='占位图''/>
                showClass: 'mescroll-lazy-in', // 图片加载成功的显示动画: 渐变显示,参见mescroll.css
                delay: 500, // 列表滚动的过程中每500ms检查一次图片是否在可视区域,如果在可视区域则加载图片
                offset: 200 // 超出可视区域200px的图片仍可触发懒加载,目的是提前加载部分图片
              },
              callback: this.more, //上拉刷新的回调,别写成downCallback(),多了括号就自动执行方法了
            }
          })
        },
    }
  })
}
</script>
</html>
